/*
 * Copyright (c) GoKeep by gokeep.org. 2022-2023. All rights reserved
 */
package org.gokeep.common.config.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Data
@Component
@ConfigurationProperties(prefix = "system.cache")
public class CacheProperties {

    private Redisson redisson;

    private Caffeine caffeine;

    /**
     * Redis配置
     */
    @Data
    public static class Redisson {
        /**
         * 是否为单机模式
         */
        private boolean useSingleServer;
        /**
         * Redis主机地址
         */
        private String address;
        /**
         * Redis 主机密码
         */
        private String password;
    }

    @Data
    public static class Caffeine {
        /**
         * 缓存初始容量，默认：1000
         */
        private Integer initialCapacity = 1000;
        /**
         * 缓存最大数据条数，默认1000000
         */
        private Integer maximumSize = 1000000;
    }

}